package com.winning.sx.microframework.service.base_entity;

import com.winning.sx.microframework.dao.base_entity.ViewDao;
import com.winning.sx.microframework.model.exception.CustomException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.sql.SQLException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class BaseConstService {

    @Autowired
    private ViewDao dao;

    public List queryDropDownList(String typeCode) throws CustomException {
        try {
            Map <String,String>param=new HashMap<String, String>();
            param.put("type",typeCode);
            return dao.queryView("BASE_ConstDropDown",param,"value").getDataRows();
        } catch (SQLException e) {
            throw new CustomException(1, e.getMessage());
        }
    }
}
